<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<style>
    .tt{width: 15%!important;}
    .tv{width: 35%!important;}
</style>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div class="table-box tablenes">
            <div class="title">工程备案信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">工程名称</td><td class="tv colorlan" id="name"></td><td class="tt">工程状态</td><td class="tv" id="state_name"></td></tr>
                <tr><td class="tt">工程编号</td><td class="tv" id="number"></td><td class="tt">报备方式</td><td class="tv" id="lanshi_name"></td></tr>
                <tr><td class="tt">开标时间</td><td class="tv" id="kaidt"></td><td class="tt">工程发布平台</td><td class="tv" id="kailei_name"></td></tr>
                <tr><td class="tt">业务归属</td><td class="tv" id="gui_unit_name"></td><td class="tt">工程负责人</td><td class="tv" id="gofuer"></td></tr>
                <tr><td class="tt">经营类别</td><td class="tv" id="jinglei" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">投标及开标信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">投标文件</td><td class="tv colorlan" id="bookinfo_name"></td><td class="tt">是否中标</td><td class="tv" id="iswin"></td></tr>
                <tr><td class="tt">中标日期</td><td class="tv" id="windt"></td><td class="tt">中标价(元)</td><td class="tv" id="winfee"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">人员信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">业绩是否录入平台</td><td class="tv" id="islu" colspan="3"></td></tr>
                <tr><td class="tt">项目经理</td><td class="tv" id="ren_xiang_name"></td><td class="tt">技术负责人</td><td class="tv" id="ren_ji_name"></td></tr>
                <tr><td class="tt">质量负责人</td><td class="tv" id="ren_zhi_name"></td><td class="tt">安全负责人</td><td class="tv" id="ren_an_name"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title"><span>前期费信息</span><span id="gotolan" class="colorlan" style="float: right;margin-right: 12px">查看前期费一览</span></div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">前期费收入(元)A</td><td id="qian_shou_fee" class="tv colorlan"></td><td class="tt">前期费支出(元)B</td><td id="qian_zhi_fee" class="tv colorlan"></td></tr>
                <tr><td class="tt">投标保证金缴纳(元)C</td><td id="tou_jiao_fee" class="tv colorlan"></td><td class="tt">投标保证金返还(招标代理公司返投标人)(元)D</td><td id="tou_fan_fee" class="tv colorlan"></td></tr>
                <tr><td class="tt">其中招标代理公司收取招标代理服务费(元)</td><td id="daifu_kou_fee" class="tv colorlan"></td><td class="tt">前期费剩余(元)A-B-C+D</td><td id="qian_run_fee" class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">保证金信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">保证金状态</td><td class="tv" id="tou_zhuang_name" colspan="3"></td></tr>
                <tr><td class="tt">保证金收取(元)</td><td class="tv colorlan" id="shou_bao_fee"></td><td class="tt">保证金缴纳(元)</td><td class="tv colorlan" id="tou_jiao_fee"></td></tr>
                <tr><td class="tt">保证金返还(元)</td><td class="tv colorlan" id="tou_fan_fee"></td><td class="tt">保证金退回(元)</td><td class="tv colorlan" id="tui_bao_fee"></td></tr>
                <tr><td class="tt">应收垫资利息(元)D</td><td class="tv colorlan" id="ying_dian_fee"></td><td class="tt">已收垫资利息(元)E</td><td class="tv colorlan" id="shou_dianli_fee"></td></tr>
                <tr><td class="tt">待收垫资利息(元)D-E</td><td class="tv colorlan" id="daishou_dianli_fee" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>


    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_bid_xiang, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;

                $("#name").text(data.name).click(function () {
                    openPage('../bid/show.php?id='+data.id);
                });
                $(".pageshowtitle").html(data.name);
                $("#state_name").html(data.state_name);
                $("#number").text(data.number);
                $("#lanshi_name").text(data.lanshi_name);
                $("#kaidt").text(data.kaidt);
                $("#kailei_name").text(data.kailei_name);
                $("#gui_unit_name").text(data.gui_unit_name);
                $("#gofuer").text(data.gofuer);
                $('#jinglei').text(data.jinglei);


                var bookinfo = res.data.bookinfo;
                if(bookinfo){
                    $("#bookinfo_name").text('已上传').click(function () {
                        openPage('../bid_book/show.php?id='+bookinfo.id);
                    });
                }
                $("#windt").text(data.windt);
                if(data.state == 3){
                    $("#iswin").text('中标');
                }
                if(data.state == 6){
                    $("#iswin").text('未中标');
                }
                $("#winfee").text(data.winfee);




                $("#islu").text(data.islu);
                get_zhiwei_info('ren_xiang_name',res.data.ren_xiang_info);
                get_zhiwei_info('ren_ji_name',res.data.ren_ji_info);
                get_zhiwei_info('ren_zhi_name',res.data.ren_zhi_info);
                get_zhiwei_info('ren_an_name',res.data.ren_an_info);


                var qian_count = res.data.qian_count;
                if(qian_count){
                    $('#qian_shou_fee').text(parseFormatNum(qian_count.qian_shou_fee)).click(function () {
                        openNavPage('前期费收取','qian_shou/index.php?status=1&bidid='+param_id);
                    })
                    $('#qian_zhi_fee').text(parseFormatNum(qian_count.qian_zhi_fee)).click(function () {
                        openNavPage('前期费支付','qian_zhi/index.php?status=1&bidid='+param_id);
                    })
                    $('#tou_jiao_fee').text(parseFormatNum(qian_count.tou_jiao_fee)).click(function () {
                        openNavPage('投标保证金缴纳','tou_jiao/index.php?status=1&bidid='+param_id);
                    })
                    $('#tou_fan_fee').text(parseFormatNum(qian_count.tou_fan_fee)).click(function () {
                        openNavPage('投标保证金返还','tou_fan/index.php?status=1&bidid='+param_id);
                    })
                    $('#daifu_kou_fee').text(parseFormatNum(qian_count.daifu_kou_fee)).click(function () {
                        openNavPage('投标保证金返还','tou_fan/index.php?status=1&bidid='+param_id);
                    })
                    $('#qian_run_fee').text(parseFormatNum(qian_count.qian_run_fee));
                }



                $("#gotolan").click(function () {
                    if(data.jinglei == '总公司'){
                        openNavPage('前期费一览-总公司','qian_lan/index.php?status=1&bidid='+param_id);
                    }else{
                        openNavPage('工程负责人前期费一览','qian_gofuer_lan/index.php?status=1&gofuer='+encodeURIComponent(data.gofuer));
                    }
                });





                if(res.data.tou_zhuang == 1){
                    $("#tou_zhuang_name").text('已收取');
                }else if(res.data.tou_zhuang == 2){
                    $("#tou_zhuang_name").text('已缴纳');
                }else if(res.data.tou_zhuang == 3){
                    $("#tou_zhuang_name").text('已返还');
                }else if(res.data.tou_zhuang == 4){
                    $("#tou_zhuang_name").text('已退回');
                }
                $("#shou_bao_fee").text(res.data.shou_bao_fee).click(function () {
                    openNavPage('保证金收取信息','qian_shou/detail.php?bidid='+data.id+'&shouqianlei=1');
                });
                $("#tou_jiao_fee").text(res.data.tou_jiao_fee).click(function () {
                    openNavPage('保证金缴纳信息','tou_jiao/index.php?bidid='+data.id);
                });
                $("#tou_fan_fee").text(res.data.tou_fan_fee).click(function () {
                    openNavPage('保证金返还信息','tou_fan/index.php?bidid='+data.id);
                });
                $("#tui_bao_fee").text(res.data.tui_bao_fee).click(function () {
                    openNavPage('保证金退回信息','qian_zhi/detail.php?bidid='+data.id+'&zhiqianlei=5');
                });
                $("#ying_dian_fee").text(res.data.ying_dian_fee).click(function () {
                    openNavPage('应收垫资利息信息','tou_jiao/index.php?bidid='+data.id);
                });
                $("#shou_dianli_fee").text(res.data.shou_dianli_fee).click(function () {
                    openNavPage('已收垫资利息信息','qian_shou/detail.php?bidid='+data.id+'&shouqianlei=4');
                });
                $("#daishou_dianli_fee").text(res.data.daishou_dianli_fee);





                render_from();
            }
        });

    });




    function get_zhiwei_info(dom, data) {
        var str = '';
        for(var key in data){
            if(str){
                str += '，<span onclick="get_cert_show('+data[key].id+')" class="colorlan">'+data[key].name+'</span>'
            }else{
                str += '<span onclick="get_cert_show('+data[key].id+')" class="colorlan">'+data[key].name+'</span>'
            }
        }
        $("#"+dom).html(str);
    }
    function get_cert_show(id) {
        openPage('../cert/show.php?id='+id);
    }







</script>
</body>
</html>




